/*******************************************************************************
 * SDP Project AUT 2012
 * 
 *                ***********Driving Assistant************
 * Team:
 * Gisela, Deidre, Brijesh, Robert
 * 
 * This class has the main method which initializes the UI.
 * 
 * @version 1.0
 * 
 * Copyright (c) 2011 by DrivingAssistant Team, Inc., All Rights Reserved.
 * 
 ******************************************************************************/
package com.drivingAssistant.main;

import com.drivingAssistant.gui.DrivingAssistantUI;

/**
 *
 * Driving Assistant UI main class
 * 
 */
public class DrivingAssistant {

    private static DrivingAssistantUI daUI = null;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // set nimbus laf
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info :
                    javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(DrivingAssistantUI.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(DrivingAssistantUI.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(DrivingAssistantUI.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DrivingAssistantUI.class
                    .getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }

        daUI = new DrivingAssistantUI();

        /*
         * Create and display the UserInterface
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                daUI.pack();
                daUI.setDefaultCloseOperation(DrivingAssistantUI.DISPOSE_ON_CLOSE);
                daUI.setLocationRelativeTo(null);
                daUI.setVisible(true);
            }
        });
    }
}
